Advanced HTML Editor Support Product Page

This topic is locked
This topic was archived

Adv HTML Editor Validation

Reported 03 Oct 2004 23:08:48
1
has this problem
03 Oct 2004 23:08:48 Ivan Halen posted:
Hello,
I noticed that if I write something in Adv HTML Editor in WYSIWYG view, then delete all and then go to HTML view, a "<p>& nbsp ;</p>" remains [I write it separated to be not interpreted as a "non-breaking-space" by the parser], and so any "not blank/empty" validation fails (i.e. with WA Validation Toolkit) becouse the field is not REALLY EMPTY

Is there a way to fix this bug, please?
Thanks

Edited by - ivanhalen on 03 Oct 2004 23:09:12

Replies

Replied 22 Oct 2004 22:56:53
22 Oct 2004 22:56:53 Camillah Ringes replied:
Hi ivan,

This is not really a bug, but something that just happens when using richtext editing.
Without anything in the editor, you cannot see a cursor.
Maybe you should adjust the validation script. Now it checks for an empty string <pre id=code><font face=courier size=2 id=code>"";</font id=code></pre id=code> let it check for <pre id=code><font face=courier size=2 id=code>"&lt;p&gt;&amp;nbsp;&lt;/p&gt;";</font id=code></pre id=code> and <pre id=code><font face=courier size=2 id=code>"&lt;br /&gt;"; (mozilla)</font id=code></pre id=code>instead.

Succes

--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 23 Oct 2004 11:18:59
23 Oct 2004 11:18:59 Ivan Halen replied:
Thanks, I'm trying some solutions, but 3 weeks to get an answer is not a good way to make "customer care" or to keep your customers satisfied...
Neither presenting the new Adv HTML Editor as a free upgrade first, and then asking for 39$ is a good way, but this is another discussion... I don't hide that I'm searching for something alternative, Adv HTML Editor is not woth the money you ask

Thanks
Replied 23 Oct 2004 17:41:12
23 Oct 2004 17:41:12 Camillah Ringes replied:
I'm very sorry that WA Validation Toolkit doesn't work with our editor. The &lt;p&gt;&amp;nbsp;&lt;/p&gt; and &lt;br /&gt; tags are deleted in an empty editor when you press the submit button, on an onsubmit event. The validator first checkes the form value before letting the onsubmit event going through.

This is what happens during onsubmit:
<pre id=code><font face=courier size=2 id=code>var contents = document.getElementById(objname).value;
if (contents.toLowerCase() == '&lt;br /&gt;' ||
contents.toLowerCase() == '&lt;p&gt;&amp;nbsp;&lt;/p&gt;' ||
contents.toLowerCase() == '&lt;br&gt;') contents = '';
document.getElementById(objname).value = contents;</font id=code></pre id=code>


'objname' is the id attribute in the textarea tag(wich has to have the same value as the name attribute).
<pre id=code><font face=courier size=2 id=code>&lt;textarea dmxedit="true" id="editor1" name="editor1" .. &gt;</font id=code></pre id=code>


You could use the above script in your validation.
So in the case above with the id being 'editor1', putting <pre id=code><font face=courier size=2 id=code>var objname = "editor1";</font id=code></pre id=code> above the mentioned script would make the empty editor 'truly' empty before the onsubmit event executes.

I don't know if it also works on other HTML editors, but you may give it a try as the script calles on the value of the textarea and not the innerHTML of the iFrame. Most editors use textarea's for rich text editing.

Succes!


--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------

Reply to this topic